home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1996 July / Amiga Games 1996 #7.iso / userbox / publicdomain / hdenv / install-hdenv < prev    next >
Text File  |  1996-04-10  |  6KB  |  159 lines

  1. ; $VER: Install-HDEnv 1.0 (10.4.96)
  2. ; Copyright (C) 1996 by Michael Fedrowitz
  3. ;
  4. ;    This program is free software; you can redistribute it and/or modify
  5. ;    it under the terms of the GNU General Public License as published by
  6. ;    the Free Software Foundation; either version 2 of the License, or
  7. ;    (at your option) any later version.
  8. ;
  9. ;    This program is distributed in the hope that it will be useful,
  10. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ;    GNU General Public License for more details.
  13. ;
  14. ;    You should have received a copy of the GNU General Public License
  15. ;    along with this program; if not, write to the Free Software
  16. ;    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ;
  18.  
  19. (set ver (/ (getversion) 65536))
  20.  
  21. (if (< ver 37)
  22.     (abort "You need at least OS 2.04 to use HDEnv.")
  23. )
  24.  
  25. (if (exists "C:HDEnv")
  26.     (set upd 1)
  27.     (set upd 0)
  28. )
  29.  
  30. (set upd
  31.     (askchoice
  32.         (prompt "Do you wish to")
  33.         (help "If you have never used HDEnv before select 'install from scratch', "
  34.               "if you are updating from HDEnv 1.1.3 or later select 'update'.\n"
  35.               "If you're updating from an earlier version you will have to "
  36.               "install it manually, sorry.\n"
  37.               "Please refer to HDEnv.guide (chapter 'Updating') for further "
  38.               "information.")
  39.         (choices "install HDEnv from scratch, or"
  40.                  "update an old HDEnv installation?")
  41.         (default upd)
  42.     )
  43. )
  44.  
  45. (if (< ver 39)
  46.     (set exe 0)
  47.     (set exe 1)
  48. )
  49.  
  50. (if (> @user-level 1)
  51.     (set exe
  52.         (askchoice
  53.             (prompt "Please select executable to install.")
  54.             (help "The two executables are functionally completely identical.\n"
  55.                   "HDEnv will work with any OS version from 2.04 (V37) up.\n"
  56.                   "HDEnv.v39 is a few hundred bytes shorter than HDEnv, but "
  57.                   "will only work with OS 3.0 (V39) or higher.")
  58.             (choices "HDEnv" "HDEnv.v39")
  59.             (default exe)
  60.         )
  61.     )
  62. )
  63.  
  64. (if (= exe 0)
  65.     (copyfiles
  66.         (prompt "Copying executable to C:.")
  67.         (help @copyfiles-help)
  68.         (source "HDEnv")
  69.         (dest "C:")
  70.         (confirm)
  71.     )
  72.     (copyfiles
  73.         (prompt "Copying executable to C:.")
  74.         (help @copyfiles-help)
  75.         (source "HDEnv.v39")
  76.         (dest "C:")
  77.         (newname "HDEnv")
  78.         (confirm)
  79.     )
  80. )
  81.  
  82. (if (= upd 0)
  83.     (
  84.         (set env
  85.             (askdir
  86.                 (prompt "Please select your new Env directory.")
  87.                 (help @askdir-help)
  88.                 (default "SYS:Env")
  89.                 (newpath)
  90.             )
  91.         )
  92.         (if (NOT (exists env))
  93.             (makedir env)
  94.         )
  95.         (if (askbool
  96.                 (prompt "Move ENV: to new Env directory?")
  97.                 (help "This will copy the contents of your old ENV: directory "
  98.                       "to its new place, update the assign and delete the old "
  99.                       "directory.")
  100.                 (default 1)
  101.             )
  102.             (
  103.                 (copyfiles
  104.                     (prompt "Copying ENV: to new Env directory.")
  105.                     (source "ENV:")
  106.                     (dest env)
  107.                     (all)
  108.                 )
  109.                 (set old (getassign "ENV"))
  110.                 (makeassign "ENV" env)
  111.                 (run (cat "Delete \"" old "\" ALL QUIET"))
  112.             )
  113.         )
  114.         (if (askbool
  115.                 (prompt "Should I try to build a new Startup-sequence?\n"
  116.                         "(A backup of you old Startup-sequence will be created.)")
  117.                 (help "A number of modifications need to be made to your "
  118.                       "Startup-sequence for HDEnv to take effect.\n"
  119.                       "This will try to do these modifications automatically, "
  120.                       "what may fail if you have a non-standard Startup-sequence.")
  121.                 (default 1)
  122.             )
  123.             (
  124.                 (run (cat "rx Install-HDEnv.rexx \"" env "\"")
  125.                     (prompt "Trying to build new Startup-sequence.")
  126.                     (safe)
  127.                 )
  128.                 (if (exists "T:Startup-sequence")
  129.                     (
  130.                         (copyfiles
  131.                             (prompt "Making backup of old Startup-sequence")
  132.                             (help @copyfiles-help)
  133.                             (source "S:Startup-sequence")
  134.                             (dest "S:")
  135.                             (newnam "Startup-sequence.bak")
  136.                             (confirm)
  137.                         )
  138.                         (copyfiles
  139.                             (prompt "Copying new Startup-sequence to S:.")
  140.                             (help @copyfiles-help)
  141.                             (source "T:Startup-sequence")
  142.                             (dest "S:")
  143.                             (confirm)
  144.                         )
  145.                         (delete "T:Startup-sequence")
  146.                         (message "Successfully built new Startup-sequence.\n"
  147.                                  "If you have a non-standard Startup-sequence "
  148.                                  "you should check if the new one is correct.\n"
  149.                                  "A backup of your old Startup-sequence can "
  150.                                  "be found in S:Startup-sequence.bak")
  151.                     )
  152.                     (message "Couldn't build new Startup-sequence.\n"
  153.                              "Please refer to HDEnv.guide (chapter 'Installation').")
  154.                 )
  155.             )
  156.         )
  157.     )
  158. )
  159.